package com.ruoyi.manger.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manger.mapper.RegulationConfigMapper;
import com.ruoyi.manger.domain.RegulationConfig;
import com.ruoyi.manger.service.IRegulationConfigService;

/**
 * 违章条例配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-14
 */
@Service
public class RegulationConfigServiceImpl implements IRegulationConfigService 
{
    @Autowired
    private RegulationConfigMapper regulationConfigMapper;

    /**
     * 查询违章条例配置
     * 
     * @param id 违章条例配置主键
     * @return 违章条例配置
     */
    @Override
    public RegulationConfig selectRegulationConfigById(Long id)
    {
        return regulationConfigMapper.selectRegulationConfigById(id);
    }

    /**
     * 查询违章条例配置列表
     * 
     * @param regulationConfig 违章条例配置
     * @return 违章条例配置
     */
    @Override
    public List<RegulationConfig> selectRegulationConfigList(RegulationConfig regulationConfig)
    {
        return regulationConfigMapper.selectRegulationConfigList(regulationConfig);
    }

    /**
     * 新增违章条例配置
     * 
     * @param regulationConfig 违章条例配置
     * @return 结果
     */
    @Override
    public int insertRegulationConfig(RegulationConfig regulationConfig)
    {
        regulationConfig.setCreateTime(DateUtils.getNowDate());
        return regulationConfigMapper.insertRegulationConfig(regulationConfig);
    }

    /**
     * 修改违章条例配置
     * 
     * @param regulationConfig 违章条例配置
     * @return 结果
     */
    @Override
    public int updateRegulationConfig(RegulationConfig regulationConfig)
    {
        regulationConfig.setUpdateTime(DateUtils.getNowDate());
        return regulationConfigMapper.updateRegulationConfig(regulationConfig);
    }

    /**
     * 批量删除违章条例配置
     * 
     * @param ids 需要删除的违章条例配置主键
     * @return 结果
     */
    @Override
    public int deleteRegulationConfigByIds(Long[] ids)
    {
        return regulationConfigMapper.deleteRegulationConfigByIds(ids);
    }

    /**
     * 删除违章条例配置信息
     * 
     * @param id 违章条例配置主键
     * @return 结果
     */
    @Override
    public int deleteRegulationConfigById(Long id)
    {
        return regulationConfigMapper.deleteRegulationConfigById(id);
    }
}
